<script type="text/javascript" src="<?php echo base_url();?>asset/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>asset/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>asset/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type='text/javascript'>
$(function() {
$( "#tanggal_surat" ).datepicker({dateFormat : "yy-mm-dd",maxDate : new Date()});
});

$(function() {
$( "#tanggal_diterima" ).datepicker({dateFormat : "yy-mm-dd",maxDate : new Date()});
});
</script>
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>

<div id="main-content">
	<div class='title'>Form Edit Surat Masuk</div>
	
	<?php $row = $surat_masuk->row();
	echo form_open('con_surat_masuk/edit/'.$row->ID_SURAT_MASUK);
	?>
	<table width='100%'> 
		<tr>
			<td>Nomor Surat</td>
			<td>:</td>
			<td>
			<?php echo form_input('no_surat',$row->NO_SURAT);?>
			<?php echo form_error('no_surat');?>
			</td>
		</tr>
		<tr>
			<td>Tanggal Surat Masuk</td>
			<td>:</td>
			<td>
			<input type="text" id="tanggal_surat" name="tanggal_surat" value="<?php echo $row->TANGGAL_SURAT;?>"/>
			<?php 
			//$proptglsurat = array(
			//'type' =>'text',
			//'name' =>'tanggal_surat',
			//'id' => 'tanggal_surat',
			//);
			//echo form_input($proptglsurat,set_value('tanggal_surat'));
			//echo form_input('tanggal_surat',set_value('tanggal_surat'));?>
			<?php echo form_error('tanggal_surat');?>
			</td>
		</tr>
		<tr>
			<td>Hal</td>
			<td>:</td>
			<td>
			<?php echo form_input('hal',$row->HAL);?>
			<?php echo form_error('hal');?>
			</td>
		</tr>
		<tr>
			<td>Asal Surat</td>
			<td>:</td>
			<td>
			<?php 
			//menampilkan dropdown asal surat
			foreach($kantor->result() as $rowk)
			{
				$array_kantor[$rowk->KD_KANTOR] = $rowk->NAMA_KANTOR;
			}
			echo form_dropdown('asal_surat',$array_kantor,$row->ASAL_SURAT);
			?>
			<?php echo form_error('asal_surat');?>
			<?php //echo form_input('asal_surat',set_value('asal_surat'));?>
			<?php //echo form_error('asal_surat');?>
			</td>
		</tr>
		<tr>
			<td>Tanggal Diterima</td>
			<td>:</td>
			<td>
			<input type="text" id="tanggal_diterima" name="tanggal_diterima" value="<?php echo $row->TANGGAL_DITERIMA;?>"/>
			<?php //echo form_input('tanggal_diterima',set_value('tanggal_diterima'));?>
			<?php echo form_error('tanggal_diterima');?>
			</td>
		</tr>
		<tr>
			<td>Butuh Tanggapan</td>
			<td>:</td>
			<td>
		
			<?php
			$options = array(
                  'Y'  => 'Ya',
                  'T'    => 'Tidak',
                );
			//$tanggapan = array ('Ya','Tidak');
			echo form_dropdown('tanggapan',$options,$row->BUTUH_TANGGAPAN); ?>
			<?php //echo form_input('butuh_tanggapan',set_value('butuh_tanggapan'));?>
			<?php //echo form_error('butuh_tanggapan');?>
			</td>
		</tr>
		<tr>
			<td>Disposisi 1</td>
			<td>:</td>
			<td>
			<?php echo form_input('disposisi1',$row->DISPOSISI1);?>
			<?php echo form_error('disposisi1');?>
			</td>
		</tr>
			<tr>
			<td>Disposisi 2</td>
			<td>:</td>
			<td>
			<?php echo form_input('disposisi2',$row->DISPOSISI2);?>
			<?php echo form_error('disposisi2');?>
			</td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td>
			<?php echo form_submit('submit','Update');?>
			</td>
		</tr>
	</table>
	<?php echo form_close();?>
</div>